package com.example.Laboratory.Controller;

import com.example.Laboratory.Entity.Achievements_software;
import com.example.Laboratory.Service.Achievements_softwareService;
import com.example.Laboratory.Untils.ResultCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;


@Api(value = "Achievements_software", description = "科研成果-软件著作权")
@RestController
@RequestMapping(value = "/Achievements_software")
@CrossOrigin
public class Achievements_softwareController {

    @Autowired
    Achievements_softwareService achievements_softwareService;

    @ApiOperation(value = "增加科研-软件著作权表信息", notes = "增加科研-软件著作权表信息")
    @RequestMapping(value = "/addAchievements_software", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
    public Object addAchievements_software (Achievements_software s) throws IOException {
        return ResultCode.SUCCESS.result(achievements_softwareService.addAchievements_software(s));
    }

    @ApiOperation(value = "删除科研-软件著作权表信息", notes = "删除科研-软件著作权表信息")
    @RequestMapping(value = "/deleteAchievements_software", method = RequestMethod.GET, produces = "application/json;charset=utf-8")
    public Object deleteAchievements_software (@RequestParam int Achievements_software_id) throws IOException {
        return ResultCode.SUCCESS.result(achievements_softwareService.deleteAchievements_software(Achievements_software_id));
    }

    @ApiOperation(value = "查找科研-软件著作权表信息", notes = "查找科研-软件著作权表信息")
    @RequestMapping(value = "/researchAchievements_software", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
    public Object researchAchievements_software ( ) throws IOException {
        return ResultCode.SUCCESS.result(achievements_softwareService.researchAchievements_software());
    }

    @ApiOperation(value = "修改科研-软件著作权表信息", notes = "修改科研-软件著作权表信息")
    @RequestMapping(value = "/reviseAchievements_software", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
    public Object reviseAchievements_software (Achievements_software s) throws IOException {
        return ResultCode.SUCCESS.result(achievements_softwareService.reviseAchievements_software(s));
    }
}
